package cn.tedu.oa_system.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @Author MW
 * @Description 在线登录用户实体类
 * @CreateDate 2023/2/26
 */
@Data
@TableName(value = "user_login_record")
public class UserLoginRecord implements Serializable {

    static final long serialVersionUID = 1L;

    @TableId
    private Long recordId;

    private String browser;

    private String ipAddr;

    private Date loginTime;

    private String sessionId;

    private Long userId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserLoginRecord that = (UserLoginRecord) o;
        return Objects.equals(recordId, that.recordId) && Objects.equals(browser, that.browser) && Objects.equals(ipAddr, that.ipAddr) && Objects.equals(loginTime, that.loginTime) && Objects.equals(sessionId, that.sessionId) && Objects.equals(userId, that.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(recordId, browser, ipAddr, loginTime, sessionId, userId);
    }

    @Override
    public String toString() {
        return "UserLoginRecord{" +
                "recordId=" + recordId +
                ", browser='" + browser + '\'' +
                ", ipAddr='" + ipAddr + '\'' +
                ", loginTime=" + loginTime +
                ", sessionId='" + sessionId + '\'' +
                ", userId=" + userId +
                '}';
    }
}
